# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.CloudTasks.V2.Model.UriOverride do
  @moduledoc """
  URI Override. When specified, all the HTTP tasks inside the queue will be partially or fully overridden depending on the configured values.

  ## Attributes

  *   `host` (*type:* `String.t`, *default:* `nil`) - Host override. When specified, replaces the host part of the task URL. For example, if the task URL is "https://www.google.com," and host value is set to "example.net", the overridden URI will be changed to "https://example.net." Host value cannot be an empty string (INVALID_ARGUMENT).
  *   `pathOverride` (*type:* `GoogleApi.CloudTasks.V2.Model.PathOverride.t`, *default:* `nil`) - URI path. When specified, replaces the existing path of the task URL. Setting the path value to an empty string clears the URI path segment.
  *   `port` (*type:* `String.t`, *default:* `nil`) - Port override. When specified, replaces the port part of the task URI. For instance, for a URI http://www.google.com/foo and port=123, the overridden URI becomes http://www.google.com:123/foo. Note that the port value must be a positive integer. Setting the port to 0 (Zero) clears the URI port.
  *   `queryOverride` (*type:* `GoogleApi.CloudTasks.V2.Model.QueryOverride.t`, *default:* `nil`) - URI query. When specified, replaces the query part of the task URI. Setting the query value to an empty string clears the URI query segment.
  *   `scheme` (*type:* `String.t`, *default:* `nil`) - Scheme override. When specified, the task URI scheme is replaced by the provided value (HTTP or HTTPS).
  *   `uriOverrideEnforceMode` (*type:* `String.t`, *default:* `nil`) - URI Override Enforce Mode When specified, determines the Target UriOverride mode. If not specified, it defaults to ALWAYS.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :host => String.t() | nil,
          :pathOverride => GoogleApi.CloudTasks.V2.Model.PathOverride.t() | nil,
          :port => String.t() | nil,
          :queryOverride => GoogleApi.CloudTasks.V2.Model.QueryOverride.t() | nil,
          :scheme => String.t() | nil,
          :uriOverrideEnforceMode => String.t() | nil
        }

  field(:host)
  field(:pathOverride, as: GoogleApi.CloudTasks.V2.Model.PathOverride)
  field(:port)
  field(:queryOverride, as: GoogleApi.CloudTasks.V2.Model.QueryOverride)
  field(:scheme)
  field(:uriOverrideEnforceMode)
end

defimpl Poison.Decoder, for: GoogleApi.CloudTasks.V2.Model.UriOverride do
  def decode(value, options) do
    GoogleApi.CloudTasks.V2.Model.UriOverride.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.CloudTasks.V2.Model.UriOverride do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
